package com.yyfax.pay.common.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 查询任务类型枚举
 * 
 * @author buyi
 * @date 2017-04-12 20:06:18
 * @since v1.0.0
 */
public enum QueryTaskTypeEnum {

	PAY("1", "支付查询"), PAYOUT("2", "单笔代付查询"),

	PAYOUT_BATCH("3", "批量代付查询"),

	PAYOUT_BATCH_RECONCILIATION("4", "批量代付对账查询"),

	PAYIN("5", "单笔代扣查询"),

	PAYIN_BATCH("6", "批量代扣查询"),

	PAYIN_BATCH_RECONCILIATION("7", "批量代扣对账查询"), 
	
	PROTOCOL_PAY("8", "协议支付");

	private String value;
	private String name;

	private QueryTaskTypeEnum(String value, String name) {
		this.value = value;
		this.name = name;
	}

	public static QueryTaskTypeEnum parseFromType(String value) {
		if (StringUtils.isBlank(value)) {
			return null;
		}

		for (QueryTaskTypeEnum queryTaskTypeEnum : QueryTaskTypeEnum.values()) {
			if (StringUtils.equals(value, queryTaskTypeEnum.getValue())) {
				return queryTaskTypeEnum;
			}
		}

		return null;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
